pragma Singleton
import QtQuick

QtObject {
    property int theme: 0 // The theme number.
    property string themeIcon: "qrc:/Icon/Dark.png" // The next theme icon.
    property color themeColor0: "#EBEBEB" // The first level theme color.
    property color themeColor1: "#F0F0F0" // The second level theme color.
    property color themeColor2: "#F7F7F7" // The second level theme color.
    property color themeColor3: "#FFFFFF" // The third level theme color.
    property color logoColor: "black" // The logo color.
    property color iconColor: "black" // The icon color.
    property color textColor: "black" // The tetx color.
    property color textBackColor: "white" // The tetx background color.
    property color hoverColor: "black" // The hover color.
    property color selectedColor: "black" // The selected color.

    Behavior on themeColor0 {
        ColorAnimation {}
    }

    Behavior on themeColor1 {
        ColorAnimation {
            duration: 500
        }
    }

    Behavior on themeColor2 {
        ColorAnimation {
            duration: 500
        }
    }

    Behavior on themeColor3 {
        ColorAnimation {
            duration: 500
        }
    }

    Behavior on logoColor {
        ColorAnimation {
            duration: 500
        }
    }

    function currentTheme() {
        return theme;
    }

    function setTheme(index) {
        theme = index;
        switch (theme) {
        default:
            theme = 0;
        case 0:
            /* Light theme. */
            themeIcon = "qrc:/Icon/Dark.png";
            themeColor0 = "#ffffff";
            themeColor1 = "#FAFAFA";
            themeColor2 = "#EDEDED";
            themeColor3 = "#FFFFFF";
            logoColor = "black";
            iconColor = "#383838";
            textColor = "#000000";
            textBackColor = "white";
            hoverColor = "#C7C7C7";
            selectedColor = "#C7C7C7";
            break;
        case 1:
            /* Dark theme. */
            themeIcon = "qrc:/Icon/Light.png";
            themeColor0 = "#292929";
            themeColor1 = "#383838";
            themeColor2 = "#545454";
            themeColor3 = "#636363";
            logoColor = "white";
            iconColor = "white";
            textColor = "white";
            textBackColor = "#1A1A1A";
            hoverColor = "#292929";
            selectedColor = "#878787";
            break;
        case 2:
            /* Dynamic theme. */
            themeIcon = "qrc:/Icon/Dynamic.png";
            themeColor0 = "#020F2B";
            themeColor1 = "#031842";
            themeColor2 = "#052769";
            themeColor3 = "#06338A";
            logoColor = "#6F00FF";
            iconColor = "white";
            textColor = "white";
            textBackColor = "#020D26";
            hoverColor = "#5D00FF";
            selectedColor = "#0CB80F";
            break;
        }
    }

    function switchTheme() {
        setTheme(theme + 1);
    }
}
